import 'react-native-gesture-handler';
import React from 'react';

import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { Examples } from '../examples/index'
import { ExampleList } from './examples'
import { BaseView } from '../components'
const Stack: any = createNativeStackNavigator();
const Routers = () => {
  const RouteViews = () => {
    return (
      <Stack.Navigator initialRouteName="Examples" screenOptions={{ headerShown: true, headerTitleAlign: 'center', }}>
        {
          ExampleList.map(item => {
            return <Stack.Screen key={item.name} name={item.name} component={item.component}></Stack.Screen>
          })
        }
      </Stack.Navigator>
    )
  }
  return (
    <SafeAreaProvider>
      <BaseView>
        <NavigationContainer>
          <RouteViews></RouteViews>
        </NavigationContainer>
      </BaseView>

    </SafeAreaProvider>
  )
}
export default Routers;